' Temporarily installing/uninstalling a font at run-time
' for use inside your program. 
' Note: You MUST install the font BEFORE you load any form
' that tries to use it, or you will generate an an error.

Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String) As Long

Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFileName As String) As Long

' To Add the Font:
Public Sub AddFont(ByVal sFontFile As String)
   Dim lResult As Long

   ' Example: lResult = AddFontResource("c:\myApp\myFont.ttf")
   lResult = AddFontResource(sFontFile)
End Sub

' To Remove the Font
Public Sub RemoveFont(ByVal sFontFile As String)
   Dim lResult As Long

   ' Example: lResult = RemoveFontResource("c:\myApp\myFont.ttf")
   lResult = RemoveFontResource(sFontFile)
End Sub
